discriminated unionをomitする
code:ts
type X = Omit<
{ type: 'a'; date: 'date'; a: 4 } | { type: 'b'; date: 'date'; b: 55 },
'date'
;
https://github.com/microsoft/TypeScript/issues/31501
code:ts
type RemoveNameField<Type> = {
Property in keyof Type as Exclude<Property, "name">: TypeProperty;
};
code:ts
type OmitUnion<T, K extends keyof any> = T extends any ? Omit<T, K> : never
Distributive Conditional Type
たぶんpickも同様?